<template>
  <div>
    <el-form :inline="true" :model="form" class="demo-form-inline">
      <el-form-item label="保修寝室:">
        <el-input v-model="form.dormitoryId" placeholder="请输入寝室号"/>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSubmit">查找</el-button>
        <el-button type="primary" @click="onRemove">重置</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  name: "search",
  data() {
    return {
      form: {
        dormitoryId: undefined
      }
    }
  },
  methods: {
    onSubmit() {
      this.$emit("searchText", this.form.dormitoryId)
    },
    onRemove() {
      this.form.dormitoryId = undefined
      this.onSubmit()
    }
  }
}
</script>

<style scoped>

</style>